home *** CD-ROM | disk | FTP | other *** search
- /* ---------------------------------------------------------------------------
- ESDemo.h
-
- ©1995 Ammon Skidmore, Skidperfect Software Inc. All Rights Reserved.
- --------------------------------------------------------------------------- */
-
- #ifndef SystemSevenOrLater
- #define SystemSevenOrLater 1
- #endif
-
- #define rIconSuiteId 257
- #define rPopupMenuID 256
- #define rArrowPictID 256
- #define rMyStringsID 256
- #define kHelpStringIndex 1 // index of the help string
- #define kIconWidth 16 // width of our icon
-
- #define kBeepIfPPC 1
- #define kHiliteClicks 3
- #define kCustomBalloons 4
- #define kCheckKeyDowns 5
- #define kUseDragNDrop 7
- #define kDragFiles 8
- #define kDragTextClippings 9
- #define kSafeFinderQuit1 11
- #define kSafeFinderQuit2 12
- #define kCloseDown 14
-
- #define kFinderType 'FNDR'
- #define kSysCreator 'MACS'
-
- // useful macros:
- #define width(rect) ((rect).right - (rect).left) // macro for rect width
- #define height(rect) ((rect).bottom - (rect).top) // macro for rect height
- #define PicFrame(what) ((**MyGlobals.what).picFrame) // macro for picture frame rect
- #define pstrcpy(dst, src) (BlockMove((src), (dst), (src)[0] + 1))
-
- #ifndef __ICONS__
- #include <Icons.h>
- #endif __ICONS__
-
- #ifndef __DRAG__
- #include <Drag.h>
- #endif __DRAG__
-
- #ifndef __CONTROLSTRIP__
- #include <ControlStrip.h>
- #endif __CONTROLSTRIP__
-
- #ifndef __EXTENSIONSSTRIP__
- #include "ExtensionsStrip.h"
- #endif __EXTENSIONSSTRIP__
-
- // our structures:
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- typedef struct
- {
- Handle iconSuite;
- MenuRef myMenuH;
- Handle myStrings;
- PicHandle myArrowPict;
- Boolean hasExtensionsStrip;
- long currentFeatures;
- // Drag globals:
- DragTrackingHandlerUPP myTrackingUPP;
- DragReceiveHandlerUPP myReceiveUPP;
- Boolean canAcceptDrag, hasEntered;
- Boolean acceptFiles, acceptText;
- ModuleReference myReferenceNum; // required only for Extensions Strip
- Rect myBox; // required only for Control/Desktop Strip
- } MyGlobals, *MyGlobalPtr, **MyGlobalHandle;
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- // our prototypes:
- void sdevDraw(MyGlobalHandle myGlobals, Rect *statusRect, GrafPtr statusPort);
- void sdevClose(MyGlobalHandle myGlobals, WindowRef statusPort);
- long sdevInit(WindowRef statusPort);
- long sdevClick(MyGlobalHandle myGlobals, const Rect *statusRect, WindowRef statusPort);
- //
- Boolean HasDragMgr(void);
- void InstallDragHandlers(WindowRef statusPort, MyGlobalHandle myH);
- void RemoveDragHandlers(WindowRef statusPort, MyGlobalHandle myH);
- Boolean HasExtensionsStrip(void);
- //
- OSErr FindAProcess(OSType typeToFind, OSType creatorToFind,
- ProcessSerialNumberPtr processSN,
- ProcessInfoRecPtr infoRecToFill);
- void QuitProcess (ProcessSerialNumber PSN, Boolean hasExtensionsStrip);
- void DrawMyIcon(MyGlobalHandle myGlobals, Boolean selected);
- pascal OSErr MyTrackingHandler(short message, WindowRef theWindow,
- void *handlerRefCon, DragReference theDrag);
- pascal OSErr MyReceiveDropHandler(WindowRef theWindow, void *handlerRefCon,
- DragReference theDrag);
-